Skip to content

Conversation

@tgelafr-pfzr
Copy link
Contributor

@tgelafr-pfzr tgelafr-pfzr commented Oct 22, 2025

Avoid deleting files ignored by git during pipelines sync.

Follow up on this issue: #2146, but avoids committing previously ignored files after switching to the TEMPLATE branch by keeping record of them before checkout.


PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.41%. Comparing base (8ff5da6) to head (eec37ca).
⚠️ Report is 3 commits behind head on dev.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tgelafr-pfzr tgelafr-pfzr linked an issue Oct 22, 2025 that may be closed by this pull request
@tgelafr-pfzr tgelafr-pfzr force-pushed the bug/2146-gitignore-pipelines-sync branch from 7104b03 to 9aa835b Compare October 31, 2025 19:30
@rrahn rrahn force-pushed the bug/2146-gitignore-pipelines-sync branch 2 times, most recently from 1954f31 to ff72cf7 Compare November 3, 2025 17:07
tgelafr-pfzr and others added 5 commits November 3, 2025 12:30
* functioning modifications and running tests

* helper functions for git file retrieval

* typos

* easier to read git add syntax

* small simplification

* Updated docstrings

* helper method for tests

* Refactoring for clarity

---------

Co-authored-by: Tatiana Gelaf Romer <[email protected]>
When some files are already globally ignored via .gitignore, git add
--all will not add them even if we want to force add all files except
some specific ones. Not using force will cause git to error out since
the files with the exclude pattern are already ignored.
@tgelafr-pfzr tgelafr-pfzr force-pushed the bug/2146-gitignore-pipelines-sync branch from fbd5b89 to 9d08715 Compare November 3, 2025 17:31
@tgelafr-pfzr tgelafr-pfzr changed the title Avoid deleting files ignored by git during pipelines sync sync: Avoid deleting files ignored by git during pipelines sync Nov 3, 2025
Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @tgelafr-pfzr, changes are looking good!

But we are moving to pathlib instead of os, could you please change the library used? For example using Path.walk() instead of os.walk(), avoiding os.path.join, etc.

@tgelafr-pfzr
Copy link
Contributor Author

tgelafr-pfzr commented Nov 6, 2025

Thanks for the contribution @tgelafr-pfzr, changes are looking good!

But we are moving to pathlib instead of os, could you please change the library used? For example using Path.walk() instead of os.walk(), avoiding os.path.join, etc.

@mirpedrol I modified as much as possible, Path.walk is only available in Python 3.12+

@mashehu mashehu merged commit 9a0ba10 into nf-core:dev Nov 7, 2025
116 checks passed
@tgelafr-pfzr tgelafr-pfzr deleted the bug/2146-gitignore-pipelines-sync branch November 10, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nf-core sync silently deletes ignored files

5 participants